//
//  DataHandel.h
//  Days
//
//  Created by lanou3g on 16/1/6.
//  Copyright © 2016年 dss. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "iflyMSC/IFlyMSC.h"

typedef void(^GETBLOCK)(id object);

//声明逆地理编码block
typedef void(^unGeographyCodingBlock)(NSString *address);

//回调位置信息的block
typedef void(^LOCATIONBLOCK)(CLLocationCoordinate2D coor);

@interface DataHandel : NSObject

@property(nonatomic,strong)IFlySpeechSynthesizer *iFlySpeechSynthesizer;
@property(nonatomic,strong)LOCATIONBLOCK updateBlock;

+(instancetype)sharedHandel;


@property(nonatomic,strong)NSArray *dataArray;
@property(nonatomic,strong) NSString *str;

//根据网址得到数据的方法
-(void)getDataWithURL:(NSString *)url withBlock:(GETBLOCK) block;

- (void)getData:(NSString *)url withBlock:(GETBLOCK) block;;

//开始定位
-(void)startLocation;
#pragma mark -- 逆地理编码(根据经纬度获取地址)
-(void)getAddressWithCoordinate:(CLLocationCoordinate2D )coordinate withFinish:(unGeographyCodingBlock)finishBlock;

#pragma mark -- 去掉空格
-(NSString *)removeBlankSpaceWithStr:(NSString *)string;
#pragma mark -- 判断网络
- (BOOL) connectedToNetwork; 
#pragma mark -- 根据字符串合成语音
-(void)readWithStr:(NSString *)string byreader:(NSString *)reader andDelegate:(NSObject *)delegate;

@end
